﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Elderos.Ontology;

namespace Elderos.Highlight.Rules
{
    [RankingRule("SynonymNonLetter", RuleType.Synonym)]
    public class RuleSynonymNonLetter : SynonymRule
    {
        public RuleSynonymNonLetter(IOntologyData ontology) : base(ontology)
        {}

        public override IRuleResult EmptyResult
        {
            get { return new BinomialResult(Name, false); }
        }

        protected override IRuleResult ComputeResult(string synonym)
        {
            bool result = Regex.IsMatch(synonym, @"[,;#/\'""]");

            return new BinomialResult(Name, result);
        }
    }
}
